pkgname=vdr-weatherng
pkgver=0.0.8_pre3
pkgrel=2
arch=('i686')
pkgdesc="A VDR plugin that shows weather for specified place"
url="http://beejay.vdr-developer.org/devel/"
license=('GPL')
depends=('vdr' 'gcc' 'imlib2')
backup=('etc/vdr/plugins/weatherng.conf')
install=vdr-weatherng.install
source=(http://www.gtlib.gatech.edu/pub/gentoo/distfiles/$pkgname-`echo $pkgver | tr _ -`.tgz \
	vdr-weatherng-script.diff weatherng.conf)
md5sums=('68dcd8c4db339cf229f986b6f37126e1' 'a91dbfe47a8f9898baeedd17af65a919'\
         '5e6b177f08793e1c0d86813b4d59819e')

build() {
  cd $startdir/src/weatherng-`echo $pkgver | tr _ -`

  patch -Np1 -i $startdir/src/vdr-weatherng-script.diff || return 1

  sed -i -e 's:colordepth  =  16;:colordepth  =   7;:' OsdWeather.c
  sed -i \
	 -e 's:@cp $@ :install -D -m 755 $@ $(DESTDIR):' \
	 -e 's:VDRVERSION:APIVERSION:g' \
	 Makefile
  make VDRDIR=/usr/include/vdr LIBDIR=/usr/lib/vdr DESTDIR=$startdir/pkg all || return 1

  install -m 755 -d $startdir/pkg/etc/vdr/plugins/weatherng/images
  install -m 644 images/* $startdir/pkg/etc/vdr/plugins/weatherng/images
  install -m 755 examples/weatherng.sh $startdir/pkg/etc/vdr/plugins/weatherng
  install -m 644 $startdir/src/weatherng.conf $startdir/pkg/etc/vdr/plugins
}
